<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定价时段</title>
<link rel="stylesheet" type="text/css" href="../img/base.css">
<script language="javascript" src="../js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
function checkvalue(period){
	var period_v = $(period).val();
	var str = /^\d+$/;
	if(!str.test(period_v))
	{
		alert('请输入数字');
		$(period).val(0);
	}
}

function del(period_id)
{
	var check_del = window.confirm('将删除该时段下的所有相关数据且无法恢复，请谨慎操作。确定删除？');
	if(check_del)
	{
		window.location = "period.php?mc_cinemaid=<{$cinemaid}>&op=delete&period_id="+period_id;
	}
}
</script>
</head>
<body leftmargin="8" topmargin="8" background='../img/allbg.gif'>
<form action="" method="post" onSubmit="checkform">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td align='center' valign='top'>
        	<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA">
            	<tr>
                	<td height="28" background="../img/tbg.gif">
                    	<div style="float:right;padding-right:6px;">
                            <a href='period.php?mc_cinemaid=<{$cinemaid}>&op=add' class='np coolbg'>添加</a>
                            <a href='cinema.php' class='np coolbg'>返回</a>
                        </div>
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr bgcolor="#FFFFFF">
                	<td height="4"></td>
                </tr>
			</table>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr bgcolor="#FFFFFF">
                	<td height="4"></td>
                </tr>
			</table>
			<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="19" background="../img/tbg.gif">§场次管理 &gt; <{$cinema_name}>&nbsp;定价时段管理 &nbsp;</td>
				</tr>
                <tr align="center" bgcolor="#FAFAF1" height="22">
                    <td>名称</td>
                    <td>优先级<strong>（值小的优先计算）</strong></td>
                    <td>备注</td>
                    <td>状态</td>
                    <td>操作</td>
                </tr>
                <{foreach item=period from=$period_list }>
                <tr align='center' bgcolor="#FFFFFF"  onMouseMove="javascript:this.bgColor='#f4fbf4';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
                    <td><{$period.period_name}></td>
                    <td><input onBlur="checkvalue(this);" type="text" name="period_<{$period.period_id}>" value="<{$period.period_priority}>"/></td>
                    <td><{$period.period_remark}></td>
                    <td><{if $period.status==0}>禁用<{elseif $period.status==1}>启用<{elseif $period.status==2}>测试<{/if}></td>
                    <td>
                    <a href="period.php?mc_cinemaid=<{$cinemaid}>&op=edit&period_id=<{$period.period_id}>">修改</a>
                    || <a href="javascript:;" onClick="del(<{$period.period_id}>);">删除</a>
                   || <a href="period_detail.php?mc_cinemaid=<{$cinemaid}>&period_id=<{$period.period_id}>">时间详情</a>
                   || <a href="price_ploy_index.php?mc_cinemaid=<{$cinemaid}>&period_id=<{$period.period_id}>">价格策略</a>
                    </td>
                </tr>
                <{/foreach}>

                <!--<tr align="right" bgcolor="#EEF4EA">
                	<td height="20" colspan="9" align="center"></td>
                </tr>-->
			</table>
            <table width="97%" border="0" cellspacing="0" cellpadding="0" >
    <tr>
        <td height="10">
        </td>
    </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
    <tr>
        <td width="25%" >&nbsp;
        </td>
        <td width="75%" >
        	<input type="hidden" name="mc_cinemaid" value="<{$cinemaid}>" />
        	<input type="hidden" name="op" value="save_priority" />
            <input name="imageField" type="image" src="../img/button_ok.gif" width="60" height="22" class="np" border="0" style="cursor:pointer; ">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <img src="../img/button_reset.gif" width="60" height="22" border="0" onClick="location.reload();" style="cursor:pointer; ">
        </td>
    </tr>
</table>
		</td>
	</tr>
</table>
</form>
</body>
</html>